<template>
  <!-- 读取本地localStorage数量内容组件 -->
  <div class="localStorage">

  </div>
</template>

<script>
  export default {
    name: 'LocalStorage',
    data () {
      return {

      }
    }
  }
  // localStorage.removeItem('titleName');
  let len = localStorage.length;
  let arr = [];
  // 循环localStorage文件将其放在数组内部
  for (let i = 0; i < len; i++) {
    let getKey = localStorage.key(i);
    let getVal = localStorage.getItem(getKey);
    arr[i] = {
      'key': getKey,
      'Val': getVal
    }
  }
  console.log(arr);

</script>

<style scoped>

</style>